package com.zuoshenge.main.controller;

import com.zuoshenge.main.entity.Student;
import com.zuoshenge.main.service.StudentDataService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("stu-info")
public class StudentInfoController {

    @Resource
    private StudentDataService studentDataService;


//    @PostMapping("/student-register")
//    public ResponseEntity<Object> StudentRegister(@RequestBody Student student) {
//        Map<String, Object> result = new HashMap<>();
//        if (studentDataService.queryStudentBySid(student.getSid()) != null) {
//            result.put("status", 0);
//            result.put("msg", "学生已经存在");
//        } else {
//            student.setPassword(passwordEncoder.encode(student.getPassword()));
//            studentDataService.addStudent(student);
//            result.put("status", 1);
//            result.put("msg", "学生信息录入成功");
//        }
//
//        return ResponseEntity.ok(result);
//    }
}
